<template>
	<view class="content">
		<view class="liwu_item" v-for="(item,index) in list" :key="index">
			<view class="cont_l">
				<!-- <image src="../../../static/yaoqing.png" mode=""></image> -->
				<image :src="ajax + item.image" mode=""></image>
				<view class="sex" ><text class="sex1 iconfont icon-nan"></text></view>
			</view>
			<view class="cont_c">
				<view class="cont_name">主播：{{item.actor}}</view>
				<view class="cont_lw">礼物：{{item.name}}</view>
			</view>
			<view class="cont_r">
				<view class="cont_num">
					<image src="../../../static/zuanshi.png" mode=""></image>
					<view class="">-{{item.price}}钻</view>
				</view>
				<view class="cont_time">{{item.createtime}}</view>
			</view>
		</view>
		<view class="wu" v-if="list.length == 0">暂无数据~</view>
	</view>
</template>

<script>
import getdata from '@/common/ajax.js';		
	export default {
		data() {
			return {
				list:[],
				ajax:''
			}
		},
		onLoad(){
			
			this.tuandui()
			this.ajax = getdata.imgUrl
		},
		methods: {
			tuandui(){
				//获取用户信息
				uni.showLoading({
				    title: '加载中'
				});
				var _this = this
				var token = uni.getStorageSync('token')
				uni.request({
					url: getdata.websiteUrl + '/movie/my_gift_log',
					header:{'content-type': "application/x-www-form-urlencoded",token:token},
					dataType: 'json',
					method: 'POST',
					success: res => {
						uni.hideLoading();
						if(res.data.code == 1){
							_this.list = res.data.data
							console.log(res)
						}else if(res.data.code == 401){
							getdata.shou('请登录')
							uni.reLaunch({
							    url: '../login/login'
							});
						}else{
							getdata.shou(res.data.msg)
						}
						
					},
					fail: res => {
						uni.hideLoading();
						getdata.shou('服务器断开链接')
					}
				});
			}
		}
	}
</script>

<style lang="scss">
@import '../../../static/iconfont/iconfont.css';	
.wu{
	text-align: center;
	font-size: 30rpx;
	color: #8D8D97;
}
.content{
	width: 100%;
	box-sizing: border-box;
	padding: 50rpx;
	.liwu_item{
		display: flex;
		margin-bottom: 70rpx;
		.cont_l{
			width: 80rpx;
			height: 80rpx;
			position: relative;
			image{
			width: 80rpx;	
			height: 80rpx;
			border-radius: 50%;
			}
			.sex{
				position: absolute;
				bottom:0;
				right:0;
				width: 28rpx;
				height: 28rpx;
				border-radius: 50%;
				background-color: #F2154E;
				.sex1{
					font-size: 22rpx;
					color: #fff;
					position: absolute;
					bottom:0;
					right:3rpx;
				}
			}
			.sex2{
				position: absolute;
				bottom:0;
				right:0;
				width: 28rpx;
				height: 28rpx;
				border-radius: 50%;
				background-color: #156DF2;
				.sex1{
					font-size: 22rpx;
					color: #fff;
					position: absolute;
					bottom:0;
					right:3rpx;
				}
			}
		}
		.cont_c{
			margin-left: 20rpx;
			.cont_name{
				font-size: 24rpx;
				line-height: 24rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #000000;
			}
			.cont_lw{
				font-size: 24rpx;
				line-height: 24rpx;
				font-family: PingFang SC;
				color: #000000;
				margin-top: 28rpx;
			}
		}
		.cont_r{
			margin-left: auto;
			justify-content: flex-end;
			.cont_num{
				display: flex;
				justify-content: flex-end;
				font-size: 24rpx;
				line-height: 24rpx;
				font-family: PingFang SC;
				color: #333333;
				image{
					width: 36rpx;
					height: 26rpx;
					margin-right: 15rpx;
				}
					
			}
			.cont_time{
				font-size: 24rpx;
				line-height: 24rpx;
				font-family: PingFang SC;
				color: #666666;
				text-align: right;
				margin-top: 25rpx;
			}
		}
	}
}
</style>
